package com.opdar.athena.entities;

import com.opdar.athena.mapper.MessageMapper;
import com.opdar.plugins.mybatis.annotations.*;

import java.sql.Timestamp;

/**
 * Created by shiju on 2017/7/2.
 */
@Namespace(MessageMapper.class)
public class MessageEntity {
    @Id
    private String id;
    private String fakeId;
    private Integer type;
    private Integer stat;
    @Like
    private String content;
    @OR("reciver")
    private String sender;
    @OR("reciver")
    private String reciver;
    private String extra;
    private Integer old;
    @Sort(type = Sort.SortType.DESC)
    @Where(value = "create_time < ",plain = false)
    @Field
    private Timestamp createTime;
    private Timestamp updateTime;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getSender() {
        return sender;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }

    public String getReciver() {
        return reciver;
    }

    public void setReciver(String reciver) {
        this.reciver = reciver;
    }

    public String getFakeId() {
        return fakeId;
    }

    public void setFakeId(String fakeId) {
        this.fakeId = fakeId;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getStat() {
        return stat;
    }

    public void setStat(Integer stat) {
        this.stat = stat;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getOld() {
        return old;
    }

    public void setOld(Integer old) {
        this.old = old;
    }

    public String getExtra() {
        return extra;
    }

    public void setExtra(String extra) {
        this.extra = extra;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "MessageEntity{" +
                "id='" + id + '\'' +
                ", fakeId='" + fakeId + '\'' +
                ", type=" + type +
                ", stat=" + stat +
                ", content='" + content + '\'' +
                ", sender='" + sender + '\'' +
                ", reciver='" + reciver + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }
}
